<template>
	<view class="components-home">
		<view class="bgImg">
			<view class="bannerBox">
				<swiper style="height: 680rpx;" class="swiper" @change="cardSwiper" circular="true" indicator-dots="true"
					autoplay="true" interval="4000" duration="600">
					<swiper-item class="swiper-list" v-for="(item, index) in bannerList" :key="index">
						<view class="swiper-item uni-bg-red">
							<image class="swiper-img radius shadow-warp" :src="item.imageUrl" mode="widthFix"></image>
						</view>
					</swiper-item>
				</swiper>
				<view class="indication">
					<block v-for="(item,index) in bannerList" :key="index">
						<view class="spot" :class="cardCur == index ? 'active': '' "></view>
					</block>
				</view>
			</view>
		</view>
		<view class="mainBox flex justify-between">
			<view @click="goProductService" class="mainBtn shadow-warp radius bg-white padding-sm margin-xs radius text-center">
				<view style="text-align: center;">
					<image src="/static/库存管理.png" mode="widthFix"
						style="width: 125rpx;border-radius: 20rpx;"></image>
				</view>
				<view class="text-bold text-black text-lg margin-top-sm text-shadow">库存管理</view>
				<view class="margin-top-sm text-gray text-sm text-shadow">点击查看商品库存</view>
			</view>
			<view @click="goAuditing" class="mainBtn shadow-warp radius bg-white padding-sm margin-xs radius text-center">
				<view style="text-align: center;">
					<image src="/static/在线报案.png" mode="widthFix" style="width: 125rpx;">
					</image>
				</view>
				<view class="text-bold text-black text-lg margin-top-sm text-shadow">库存审核</view>
				<view class="margin-top-sm text-gray text-sm text-shadow">点击进行审核查询</view>
			</view>
		</view>
		<view class="mainBox flex justify-between">
			<view @click="goService" class="mainBtn shadow-warp radius bg-white padding-sm margin-xs radius text-center">
				<view style="text-align: center;">
					<image src="/static/我的服务.png" mode="widthFix"
						style="width: 125rpx;border-radius: 20rpx;"></image>
				</view>
				<view class="text-bold text-black text-lg margin-top-sm text-shadow">我的服务</view>
				<view class="margin-top-sm text-gray text-sm text-shadow">点击查看已预约服务</view>
			</view>
		
			<view @click="goAttendance" class="mainBtn shadow-warp radius bg-white padding-sm margin-xs radius text-center">
				<view style="text-align: center;">
					<image src="/static/报案进度.png" mode="widthFix" style="width: 125rpx;">
					</image>
				</view>
				<view class="text-bold text-black text-lg margin-top-sm text-shadow">考勤打卡</view>
				<view class="margin-top-sm text-gray text-sm text-shadow">点击进行考勤打卡</view>
			</view>
		</view>
		<!-- <view style="height: 120rpx;width: 1rpx;"></view> -->
		<tabbar-footer></tabbar-footer>
	</view>
</template>

<script>
	import tabbarFooter from '../tabbar/tabbar-footer.vue'
	export default {
		data() {
			return {
				cardCur: 0,
				bannerList: [{
						imageUrl: '/static/pic_1.jpeg'
					},
					{
						imageUrl: '/static/pic_2.jpg'
					}
				],
				modalName: null, //会员弹窗
			}
		},
		onShow() {

		},
		mounted() {

		},
		components: {
		  tabbarFooter
		},
		methods: {
			showModal() {
				this.modalName = 'Modal'
			},
			hideModal() {
				this.modalName = null;
			},
			cardSwiper(e) {
				this.cardCur = e.detail.current
			},
			goProductService() {
				uni.navigateTo({
					url: '/pages/product/product'
				})
			},
			goAuditing() {
				uni.navigateTo({
					url: '/pages/auditing/auditing'
				})
			},
			goService() {
				uni.navigateTo({
					url: '/pages/service/service'
				})
			},
			goAttendance() {
				uni.navigateTo({
					url: '/pages/attendance/attendance'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.swiper-item {
		height: 100%;
	}

	/* 轮播指示点 start*/
	.indication {
		z-index: 9999;
		width: 100%;
		height: 36rpx;
		position: absolute;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	.spot {
		background-color: #FFFFFF;
		opacity: 0.6;
		width: 10rpx;
		height: 10rpx;
		border-radius: 20rpx;
		top: -130rpx;
		margin: 0 8rpx !important;
		position: relative;
	}

	.spot.active {
		opacity: 1;
		width: 30rpx;
		background-color: #0081ff;
	}

	.bgImg {
		position: relative;
		margin-bottom: 100rpx;

		.left_box {
			position: absolute;
			height: 130rpx;
			width: 60%;
			background: #ffffff;
			bottom: -55rpx;
			left: 5%;
			border-radius: 15rpx;
		}

		.right_box {
			text-align: center;
			position: absolute;
			height: 130rpx;
			width: 25%;
			background: #ffffff;
			bottom: -55rpx;
			right: 5%;
			border-radius: 15rpx;
		}
	}

	.mainBox {
		width: 750rpx;
		height: 300rpx;
		padding: 0 5%;
		margin-bottom: 10rpx;

		.mainBtn {
			width: 45%;
		}
	}

	.radius {
		border-radius: 18rpx !important;
	}

	// 弹窗
	.cu-dialog {
		background: #FFFFFF;
		overflow: visible;
	}

	.modal_bg {
		width: 100%;
		height: 400rpx;
		position: absolute;
		top: -100rpx;
		background-image: url(https://zhoukaiwen.com/img/qdpz/modal_bg.png);
		background-size: 100%;
		background-repeat: no-repeat;
	}

	.modal_main {
		text-align: left;
		background-color: #FFFFFF;
	}

	.title-header {
		position: absolute;
		bottom: 0;
		width: 100%;
		display: flex;
		height: 120rpx;
		font-size: 40rpx;
		align-items: center;
		justify-content: center;
		font-weight: bold;
		background-image: url(https://cdn.zhoukaiwen.com/wccswF.png);
		background-size: cover;
	}

	.title-text {
		background-image: -webkit-linear-gradient(0deg, #ff8a34, #FBBD12);
		-webkit-background-clip: text;
		-webkit-text-fill-color: transparent;
	}
</style>